package com.example.model;

import java.util.Random;

public class Task {
    private String taskId;
    private String taskName;
    private String taskDescription;
    private String taskStart;
    private String taskEnd;
    private String courseId;
    private String status;

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Task(){
        this.taskId=random();
    }

    @Override
    public String toString() {
        return "Task{" +
                "taskId='" + taskId + '\'' +
                ", taskName='" + taskName + '\'' +
                ", taskDescription='" + taskDescription + '\'' +
                ", taskStart=" + taskStart +
                ", taskEnd=" + taskEnd +
                ", courseId='" + courseId + '\'' +
                '}';
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public String getTaskId() {
        return taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskDescription() {
        return taskDescription;
    }

    public void setTaskDescription(String taskDescription) {
        this.taskDescription = taskDescription;
    }

    public String getTaskStart() {
        return taskStart;
    }

    public void setTaskStart(String taskStart) {
        this.taskStart = taskStart;
    }

    public String getTaskEnd() {
        return taskEnd;
    }

    public void setTaskEnd(String taskEnd) {
        this.taskEnd = taskEnd;
    }
    public  String random() {
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        int count = 0;

        while (count < 6) {
            char letter = (char) (random.nextInt(26) + 'A');
            if (sb.indexOf(String.valueOf(letter)) == -1) {
                sb.append(letter);
                count++;
            }
        }

        return sb.toString();
    }

}
